const article = require('../../model/article');
const Comment = require('../../model/comment');
module.exports = async(req, res) => {
    let id = req.query.id
    let result = await article.findOne({ _id: id }).populate('author').lean();
    // res.send(result);
    let comments = await Comment.find().populate('uid').lean();
    // res.send(comments);
    res.render('home/article', { result, comments });
}